import org.eclipse.swt.graphics.FontData;

/**
 * Provides simple utilities for fonts
 * 
 * @author johan
 */
public class FontUtils {
    /**
     * Lookup table for font styles and names
     * 
     * SWT.NORMAL = 0, SWT.BOLD = 1, SWT.ITALIC = 2, SWT.BOLD | SWT.ITALIC = 3
     */
    private static final String[] FONT_STYLE_NAMES = { "Normal", "Bold",
        "Italic", "Bold Italic" };

    /*
     */
    private FontUtils() {

    }

    /**
     * Returns a text representation of the styles of a font
     * 
     * @param fontData
     *            FontData
     * @return font style as string
     */
    public static String getFontStyles(FontData fontData) {
        return FONT_STYLE_NAMES[fontData.getStyle()];
    }
}
